﻿@using Webdiyer.WebControls.Mvc
@model List<Dal.Entities.Message>
@{
    Layout = null;
    ViewBag.Nav = 8;
    int ti = 1;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>病例录入</title>
    @Html.Partial("meta")
</head>
<body id="b_main">
    @Html.Partial("header")
    <!--/end #header-->
    <div id="wrapper">
        <!--holds pretty much everything-->
        @Html.Action("index", "news")
        <!--/end #menu_main-->
        <div id="content">
            @Html.Partial("nav")
            @if (!Web.Controllers.Common.Admin())
            {
                <div class="container1">
                    <a href="/msg/add">给管理员/审核员留言</a>
                </div>
            }
            @if (Model != null && Model.Count > 0)
            {
                <table cellspacing="0" summary="table" class="broom_table" width="90%" style="margin-left: 30px;">
                    <tbody>
                        <tr class="@((ti++) % 2 == 1 ? "odd" : "even")">
                            <td>
                                留言列表
                            </td>
                            <td>
                                操作
                            </td>
                        </tr>
                        @foreach (var msg in Model)
                        {
                            <tr class="@((ti++) % 2 == 1 ? "odd" : "even")">
                                <td>
                                    @if (!Web.Controllers.Common.Admin())
                                    {
                                        @: 我的留言
                                    }
                                    else
                                    {
                                        @Web.Controllers.Common.GetUserName(msg.SenderUserID) @:留言
                                    }
                                    (@msg.AddTime.ToString("yyyy-MM-dd")):<br />
                                    &nbsp;&nbsp;&nbsp;&nbsp; @msg.MsgContent
                                    <hr />
                                    管理员回复 @(msg.ReplyTime.HasValue ? "(" + msg.ReplyTime.Value.ToString("yyyy-MM-dd") + ")" : ""):
                                    <br />
                                    &nbsp;&nbsp;&nbsp;&nbsp; @(string.IsNullOrWhiteSpace(msg.ReplyContent) ? "暂无回复内容" : msg.ReplyContent)
                                </td>
                                <td>
                                    @if (Web.Controllers.Common.Admin())
                                    {    <a href="/msg/reply?id=@msg.ID">回复</a> }<a onclick="return confirm('确定要删除信息吗')" href="/msg/delete?id=@msg.ID">
                                        删除</a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            }
            else
            {
                <div class="container1">
                    <div class="notification error">
                        <a class="close" href="#"></a><em>
                            <img alt="" src="/assets/img/icons/cross_circle.png">无留言数据&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        </em>
                    </div>
                </div>
            }
            <div style="padding-left: 30px;">
                @Html.Pager((int)ViewBag.RecordCount, 10, (int)ViewBag.PageIndex, "index", "msg", null, null, null, new { @class = "pagination" })
            </div>
            <!--/end .tabber-->
        </div>
    </div>
    <div class="clear">
    </div>
</body>
</html>
